package com.alks.function.controller.chengKong;


import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.chengKong.*;
import com.alks.function.service.chengKong.RAndDUsageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.Map;

@ApiRestController("/usage")
@Api(tags = {"成控部-物料管理作业-研发用量建档"})
@Slf4j
public class RAndDUsageController {

    @Resource
    private RAndDUsageService rAndDUsageService;

    @WebLogger
    @PostMapping("/getStyleUsageAdd")
    @ApiOperation(value = "新增",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getStyleUsageAdd(@RequestBody Map<String,String> map){
        return rAndDUsageService.getStyleUsageAdd(map);
    }

    @WebLogger
    @PostMapping("/getStyleUsageDetailAdd")
    @ApiOperation(value = "保存",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getStyleUsageDetailAdd(@RequestBody StyleColorMaterialAddRequest request){
        return rAndDUsageService.getStyleUsageDetailAdd(request);
    }

    @WebLogger
    @PostMapping("/getCheckOut/{choose}")
    @ApiOperation(value = "0检核/1取消检核",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getCheckOut(@RequestBody Map<String,String> map, @PathVariable("choose") Integer choose){
        return rAndDUsageService.getCheckOut(map,choose);
    }

    @WebLogger
    @PostMapping("/getPrecautionsForFilingAdd")
    @ApiOperation(value = "注意事项建档",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getPrecautionsForFilingAdd(@RequestBody Map<String,String> map){
        return rAndDUsageService.getPrecautionsForFilingAdd(map);
    }

    @WebLogger
    @PostMapping("/getPrecautionsForFilingList")
    @ApiOperation(value = "注意事项建档列表",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getPrecautionsForFilingList(@RequestBody Map<String,String> map){
        return rAndDUsageService.getPrecautionsForFilingList(map);
    }

    @WebLogger
    @PostMapping("/getPrecautionsForFilingSave")
    @ApiOperation(value = "注意事项建档保存",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getPrecautionsForFilingSave(@RequestBody PrecautionsForFilingUpdateRequest request){
        return rAndDUsageService.getPrecautionsForFilingSave(request);
    }

    @WebLogger
    @PostMapping("/getCopyingMaterials")
    @ApiOperation(value = "复制资料",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getCopyingMaterials(@RequestBody CopyingMaterialsRequest request){
        return rAndDUsageService.getCopyingMaterials(request);
    }

    @WebLogger
    @PostMapping("/getDeleteTickRecords")
    @ApiOperation(value = "删除打勾记录",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getDeleteTickRecords(@RequestBody StyleR2DDelRequest request){
        return rAndDUsageService.getDeleteTickRecords(request);
    }

    @WebLogger
    @PostMapping("/getDeleteStyleColorList")
    @ApiOperation(value = "整单型体颜色删除",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getDeleteStyleColorList(@RequestBody Map<String,String> map){
        return rAndDUsageService.getDeleteStyleColorList(map);
    }

    @WebLogger
    @PostMapping("/getFullCodeDetailRenew")
    @ApiOperation(value = "更新全码用量",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getFullCodeDetailRenew(@RequestBody FullCodeRenewRequest request){
        return rAndDUsageService.getFullCodeDetailRenew(request);
    }

    @WebLogger
    @PostMapping("/getFullCodeDetailDel")
    @ApiOperation(value = "删除全码用量",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getFullCodeDetailDel(@RequestBody FullCodeRenewRequest request){
        return rAndDUsageService.getFullCodeDetailDel(request);
    }

    @WebLogger
    @PostMapping("/getUsageDetailsQuery")
    @ApiOperation(value = "用量明细查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getUsageDetailsQuery(@RequestBody UsageDetailsQueryRequest request){
        return rAndDUsageService.getUsageDetailsQuery(request);
    }

    @WebLogger
    @PostMapping("/getFullCodeDetailList")
    @ApiOperation(value = "全码用量资料查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getFullCodeDetailList(@RequestBody FullCodeRenewGetRequest request){
        return rAndDUsageService.getFullCodeDetailList(request);
    }

    @WebLogger
    @PostMapping("/getUsageDetailsChangeQuery")
    @ApiOperation(value = "用量变更查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getUsageDetailsChangeQuery(@RequestBody UsageDetailsQueryChangeRequest request){
        return rAndDUsageService.getUsageDetailsChangeQuery(request);
    }

    @WebLogger
    @PostMapping("/getStyleQuery")
    @ApiOperation(value = "型体查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getStyleQuery(@RequestBody UsageDetailsQueryChangeRequest request){
        return rAndDUsageService.getStyleQuery(request);
    }

    @WebLogger
    @PostMapping("/getStyleToColorQuery")
    @ApiOperation(value = "型体颜色图片查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getStyleToColorQuery(@RequestBody UsageDetailsQueryChangeRequest request){
        return rAndDUsageService.getStyleToColorQuery(request);
    }

    @WebLogger
    @PostMapping("/getStyleToColorDetailsQuery")
    @ApiOperation(value = "型体颜色资料输入查询",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getStyleToColorDetailsQuery(@RequestBody Map<String,String> map){
        return rAndDUsageService.getStyleToColorDetailsQuery(map);
    }

    @WebLogger
    @PostMapping("/getDetailsOfAdhesiveSubMaterials")
    @ApiOperation(value = "贴合子材料明细",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getDetailsOfAdhesiveSubMaterials(@RequestBody Map<String,String> map){
        return rAndDUsageService.getDetailsOfAdhesiveSubMaterials(map);
    }

    @WebLogger
    @PostMapping("/getDetailsOfAdhesiveSubMaterialsUpdate/{choose}")
    @ApiOperation(value = "贴合子材料明细-修改",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getDetailsOfAdhesiveSubMaterialsUpdate(@RequestBody Map<String,String> map, @PathVariable("choose") @ApiParam("0 请购,1不请购") Integer choose ){
        return rAndDUsageService.getDetailsOfAdhesiveSubMaterialsUpdate(map,choose);
    }

    @WebLogger
    @PostMapping("/getCopyingDosageList")
    @ApiOperation(value = "复制用量列表",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getCopyingDosageList(@RequestBody CopyingDosageQueryRequest request){
        return rAndDUsageService.getCopyingDosageList(request);
    }

    @WebLogger
    @PostMapping("/getCopyingDosage")
    @ApiOperation(value = "复制用量",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getCopyingDosage(@RequestBody CopyingDosageRequest request){
        return rAndDUsageService.getCopyingDosage(request);
    }

    @WebLogger
    @PostMapping("/getReordering")
    @ApiOperation(value = "重排序号",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo getReordering(@RequestBody StyleNoToColorRequest request){
        return rAndDUsageService.getReordering(request);
    }

    @WebLogger
    @PostMapping("/ColorCodeUpdate")
    @ApiOperation(value = "颜色代码更新",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo ColorCodeUpdate(@RequestParam String styleNo){
        return rAndDUsageService.ColorCodeUpdate(styleNo);
    }

    @WebLogger
    @PostMapping("/updateBaseSize")
    @ApiOperation(value = "修改基本码",tags = "成控部-物料管理作业-研发用量建档")
    public ResponseInfo updateBaseSize(@RequestBody StyleColorMaterialAddRequest request){
        return rAndDUsageService.updateBaseSize(request);
    }
}
